﻿<Window x:Class="AttentenceCheckSystem.StaffWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tableAdapters="clr-namespace:AttentenceCheckSystem.Database1DataSetTableAdapters"
        Title="员工信息" Height="480" Width="640" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ObjectDataProvider x:Key="User"
                            ObjectType="{x:Type tableAdapters:userTableAdapter}"
                            IsAsynchronous="True"
                            MethodName="GetData"
                            />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <DataGrid AutoGenerateColumns="False" Name="dataGrid1" VerticalAlignment="Stretch" ItemsSource="{Binding}" CanUserAddRows="True" 
                  CanUserDeleteRows="True" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" AlternatingRowBackground="#FFC6D6FC" GridLinesVisibility="None">
            <DataGrid.Columns>
                <DataGridTextColumn Header="ID" Binding="{Binding ID}"/>
                <DataGridTextColumn Header="姓名" Binding="{Binding 姓名}"/>
                <DataGridTemplateColumn Header="入职日期">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock HorizontalAlignment="Center" Text="{Binding 入职日期,StringFormat={}{0:yyyy/MM/dd}}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <DatePicker SelectedDate="{Binding 入职日期}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellEditingTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="转正日期" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock HorizontalAlignment="Center" Text="{Binding 转正日期,StringFormat={}{0:yyyy/MM/dd}}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <DatePicker SelectedDate="{Binding 转正日期}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellEditingTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
            <Button Content="确 认" Height="23" HorizontalAlignment="Center" Name="button1" Width="75" Click="button1_Click" />
            <Button Content="取 消" Height="23" HorizontalAlignment="Center" Name="button2" Width="75" Margin="40,0,0,0" Click="button2_Click" />
        </StackPanel>
        
    </Grid>
</Window>
